//package jp.sourceforge.talisman.mds.cluster;
//
///*
// * $Id: HierarchicalClusteringParameterTest.java,v 1.1 2009/09/12 05:06:00 weiwei Exp $
// */
//
//import jp.sourceforge.talisman.mds.Item;
//import jp.sourceforge.talisman.mds.distance.CityBlockItemDistanceCalculator;
//import jp.sourceforge.talisman.mds.distance.ClusterDistanceAlgorithm;
//import jp.sourceforge.talisman.mds.distance.ClusterDistanceCalculator;
//import jp.sourceforge.talisman.mds.distance.DistanceCalculatorFactory;
//import jp.sourceforge.talisman.mds.distance.DominanceMetricCalculator;
//import jp.sourceforge.talisman.mds.distance.FurthestNeighborClusterDistanceCalculator;
//import jp.sourceforge.talisman.mds.distance.ItemDistanceAlgorithm;
//
//import org.junit.Assert;
//import org.junit.Before;
//import org.junit.Test;
//
///**
// * 
// * @author Haruaki Tamada
// * @version $Revision: 1.1 $ 
// */
//public class HierarchicalClusteringParameterTest{
//    private HierarchicalClusteringParameter param;
//
//    @Before
//    public void initialize(){
//        param = new HierarchicalClusteringParameter(2);
//    }
//
//    @Test
//    public void testBasic(){
//        Assert.assertEquals(2, param.getNumberOfCluster());
//        Assert.assertNull(param.getDistanceCalculator());
//        Assert.assertNull(param.getClusterDistanceCalculator());
//
//        Assert.assertFalse(param.isValid(new Item[0]));
//        Assert.assertFalse(param.isValid(new Item[10]));
//    }
//
//    @Test
//    public void testBasic2(){
//        param = new HierarchicalClusteringParameter(
//            2, new CityBlockItemDistanceCalculator(), new FurthestNeighborClusterDistanceCalculator()
//        );
//        Assert.assertEquals(2, param.getNumberOfCluster());
//        Assert.assertTrue(param.getDistanceCalculator() instanceof CityBlockItemDistanceCalculator);
//        Assert.assertTrue(param.getClusterDistanceCalculator() instanceof FurthestNeighborClusterDistanceCalculator);
//        Assert.assertTrue(param.getClusterDistanceCalculator().getItemDistanceCalculator() instanceof CityBlockItemDistanceCalculator);
//
//        Assert.assertFalse(param.isValid(new Item[0]));
//        Assert.assertTrue(param.isValid(new Item[10]));
//    }
//
//    @Test
//    public void testBasic3(){
//        param = new HierarchicalClusteringParameter(
//            2, ItemDistanceAlgorithm.CITY_BLOCK_DISTANCE, ClusterDistanceAlgorithm.FURTHEST_NEIGHBOR_METHOD
//        );
//
//        Assert.assertEquals(2, param.getNumberOfCluster());
//        Assert.assertTrue(param.getDistanceCalculator() instanceof CityBlockItemDistanceCalculator);
//        Assert.assertTrue(param.getClusterDistanceCalculator() instanceof FurthestNeighborClusterDistanceCalculator);
//
//        param.setDistanceCalculator(ItemDistanceAlgorithm.DOMINANCE_METRIC);
//        Assert.assertTrue(param.getDistanceCalculator() instanceof DominanceMetricCalculator);
//        Assert.assertTrue(param.getClusterDistanceCalculator().getItemDistanceCalculator() instanceof DominanceMetricCalculator);
//    }
//
//    @Test
//    public void testCalculator(){
//        param.setDistanceCalculator(ItemDistanceAlgorithm.CITY_BLOCK_DISTANCE);
//
//        Assert.assertTrue(param.getDistanceCalculator() instanceof CityBlockItemDistanceCalculator);
//
//        param.setDistanceCalculator(DistanceCalculatorFactory.getInstance().getItemDistanceCalculator(ItemDistanceAlgorithm.DOMINANCE_METRIC));
//        Assert.assertTrue(param.getDistanceCalculator() instanceof DominanceMetricCalculator);
//    }
//
//    @Test(expected=NullPointerException.class)
//    public void testNullCheck(){
//        param.setClusterDistanceCalculator((ClusterDistanceCalculator)null);
//    }
//
//    @Test(expected=NullPointerException.class)
//    public void testNullCheck2(){
//        param.setClusterDistanceCalculator((ClusterDistanceAlgorithm)null);
//    }
//
//    @Test(expected=NullPointerException.class)
//    public void testNullCheck3(){
//        param.setClusterDistanceCalculator(ClusterDistanceAlgorithm.GROUP_AVERAGE_METHOD);
//    }
//}
